package com.qd.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 登录日志
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_login_log")
public class LoginLog extends Model<LoginLog> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "log_id", type = IdType.ASSIGN_ID)
    private String logId;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;
    /**
     * 用户姓名
     */
    @TableField("user_name")
    private String userName;
    /**
     * 账号
     */
    @TableField("account")
    private String account;
    /**
     * IP地址
     */
    @TableField("user_ip")
    private String userIp;
    /**
     * 浏览器
     */
    @TableField("browser")
    private String browser;
    /**
     * 操作系统
     */
    @TableField("os")
    private String os;
    /**
     * 登录状态
     */
    @TableField("status")
    private String status;
    /**
     * 说明
     */
    @TableField("message")
    private String message;
    /**
     * 访问时间
     */
    @TableField("login_time")
    private LocalDateTime loginTime;
    /**
     * 机构名称
     */
    @TableField("org_name")
    private String orgName;
    /**
     * 机构ID
     */
    @TableField("org_id")
    private String orgId;

    public void freeData() {
        this.logId = null;
        this.userId = null;
        this.userName = null;
        this.account = null;
        this.userIp = null;
        this.browser = null;
        this.os = null;
        this.status = null;
        this.message = null;
        this.loginTime = null;
        this.orgName = null;
        this.orgId = null;
    }

}
